package com.example.demo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class FirstServlet {
    super();
    @Override
    public void destroy(){
        super.destroy();
    }
    @Override
    public void init() throws SecurityException{
        super.init();
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws SecurityException, IOException{
        response.getCharacterEncoding("UTF-8");
        response.getContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<!DOCTYPE HTML PUBLIC\"-//W3C//DTD HTML 4.01 Transitional//EN\">");
        out.println("<html>");
        out.println("<HEAD><TITLE>动态 生成的HTML文档</TITLE></HEAD>");
        out.println("<BODY>");
        out.println("<table border=\"1\">");
        out.println("<tr><td bgcolor='skyblue'colspan=2>动态生成HTML文档</td></tr>");
        out.println("</table>");
        out.println("</BODY>");
        out.println("</HTML>");
        out.flush();
        out.close();

    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws SecurityException, IOException{
        doPost(request, response);
    }
}
